﻿<style>
    #tab.table > thead > tr > th, #tab.table > tbody > tr > th, #tab.table > tfoot > tr > th, #tab.table > thead > tr > td, #tab.table > tbody > tr > td, #tab.table > tfoot > tr > td {
        vertical-align: middle;
        text-align: center;
    }

    .default-tab input, .default-tab select {
        border: none;
        box-shadow: none !important;
    }

    a .iconfont {
        margin-right: 5px;
        font-size: 12px;
    }
</style>



<div class="form-horizontal" ms-controller="ZCYLB">
    <h3 style="text-align: center">付款一览表</h3>

    <div style="margin: 20px;">



        <div class="default-tab ft14 pt20">
            <table class="table table-hover table-bordered" id="tab">

                <thead style="background: #f7f7f7;">
                    <tr>
                        <th colspan="2" class="text-right">编号</th>
                        <th colspan="2">
                            <input type="text" class="szhl_require" placeholder="请输入编号"  title="编号" value="" ms-duplex="modelData.BH" style="width: 100%; border-bottom: 1px solid #ddd;" />
                        </th>
                        <th colspan="2" class="text-right">提交时间</th>
                        <th colspan="2">
                            <input type="text" placeholder="请输入提交时间" value="" ms-duplex="modelData.TJDate" class="szhl_form_date"  style="width: 100%; border-bottom: 1px solid #ddd;" />
                        </th>
                    </tr>
                    <tr>
                        <th colspan="2" class="text-right">付款单位</th>
                        <th colspan="2">
                            <input type="text" class="szhl_require" placeholder="请输入付款单位"  title="付款单位"  value="" ms-duplex="modelData.FKDW" style="width: 100%; border-bottom: 1px solid #ddd;" />
                        </th>
                        <th colspan="2" class="text-right">付款账号</th>
                        <th colspan="2">
                            <input type="text" class="szhl_require" placeholder="请输入付款账号"  title="付款账号"  value="" ms-duplex="modelData.FKZH" style="width: 100%; border-bottom: 1px solid #ddd;" />
                        </th>
                    </tr>
                    <tr>
                        <th width="50px">序号</th>
                        <th width="100px">收款单位</th>
                        <th width="80px">收款开户行</th>
                        <th width="100px">收款开户联行号</th>
                        <th width="100px">收款账号</th>
                        <th width="100px">用途</th>
                        <th width="100px">本次请款金额</th>
                        <th width="100px">备注</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ms-repeat-item="jhmxdata">
                        <td>{{$index+1}}</td>
                        <td>{{item.skdw}}</td>
                        <td>{{item.skkhh}}</td>
                        <td>{{item.khhlhh}}</td>
                        <td>{{item.skzh}}</td>
                        <td>{{item.FLName}}</td>
                        <td>
                            <input type="text" placeholder="请输入付款金额" class="yje" value="" ms-duplex="item.ylbje" style="width: 100%; border-bottom: 1px solid #ddd;" /></td>
                        <td style="word-break: break-all">{{item.Remark1}}</td>

                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="4" style="text-align: right; font-weight: bold">合计：{{modelData.HJJE}}
                        </td>
                        <td colspan="4" style="text-align: right; font-weight: bold">大写：{{modelData.HJJEDX}}</td>

                    </tr>

                </tfoot>
            </table>
        </div>
    </div>
</div>
<script>
    var tempmodel = avalon.define({
        $id: "ZCYLB",
        name: "付款一览表",
        modelData: { "FKDW": "", "FKZH": "", "HJJE": "", "HJJEDX": "", "BH": "", "JHMXID": "", "TJDate": "" },
        jhmxdata: [],
        iswf: true,//是否属于流程表单
        inittemp: function (strId) {
            $(".yje").live('change', function () {

                var jehj = 0;
                for (var i = 0; i < tempmodel.jhmxdata.length; i++) {
                    jehj = jehj * 1 + tempmodel.jhmxdata[i].ylbje * 1;
                }
                tempmodel.modelData.HJJE = jehj;
                tempmodel.modelData.HJJEDX = ComFunJS.smalltoBIG(jehj);
            })
            $(".yje").change(function () {


            })
            if (strId) {
                //编辑加载数据
                $.getJSON('/API/VIEWAPI.ashx?Action=ZCZX_GETMODEL', { P1: strId }, function (result) {
                    if (result.ErrorMsg == "") {
                        tempmodel.modelData = result.Result;
                        $.getJSON('/API/VIEWAPI.ashx?Action=ZCZX_GETYLBINITDATA', { P1: tempmodel.modelData.JHMXID }, function (resultData) {
                            if (resultData.ErrorMsg == "") {
                                tempmodel.jhmxdata = resultData.Result;
                                ComFunJS.initForm()
                            }
                        })

                        setTimeout(" ComFunJS.initForm()", 500)
                    }
                })
            } else {
                tempmodel.modelData.JHMXID = ComFunJS.getQueryString("MXID", "0");
                $.getJSON('/API/VIEWAPI.ashx?Action=ZCZX_GETYLBINITDATA', { P1: ComFunJS.getQueryString("MXID", "0") }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        var jehj = 0;
                        for (var i = 0; i < resultData.Result.length; i++) {
                            resultData.Result[i].ylbje = resultData.Result[i].jdje;
                            jehj = jehj * 1 + resultData.Result[i].ylbje * 1;
                        }
                        tempmodel.jhmxdata = resultData.Result;
                        tempmodel.modelData.HJJE = jehj;
                        tempmodel.modelData.HJJEDX = ComFunJS.smalltoBIG(jehj);
                        ComFunJS.initForm()

                    }
                })
            }





        },//初始化
        SaveData: function (callback) {

          

            $.post("/API/VIEWAPI.ashx?ACTION=ZCZX_ADDFKYLB", { P1: JSON.stringify(tempmodel.modelData.$model), P2: JSON.stringify(tempmodel.jhmxdata.$model) }, function (result) {
                return callback.call(this, result);
            });
        },
        Complate: function () {
            tempmodel.modelData.jexj = 0;
            tempmodel.modelData.xmqbid = "";

        },
        WFComplate: function () {
            $.getJSON("/API/VIEWAPI.ashx?ACTION=ZCZX_COMPLTE", { P1: JSON.stringify(tempmodel.modelData.$model) }, function (result) {

            });
        },
        rebackform: function () {
            $.getJSON("/API/VIEWAPI.ashx?ACTION=ZCZX_REBACK", { P1: JSON.stringify(tempmodel.modelData.$model) }, function (result) {

            });
        }
    });//# sourceURL=ZCYLB.js;
</script>
